<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://amc.af.mil/portal-el" prefix="portal" %>
<%@ taglib uri="http://amc.af.mil/radtaglibrary" prefix="rad" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<html>
<head>
    <title>View Detail By Model</title>
</head>

<body>

<rad:useBean id="equipmentItemViewHelper"/>
<rad:useBean id="itemModelViewHelper"/>

<div id="portal-left-bar">
    <jsp:include page="../navigation/navigationMenu.jsp"/>
</div>

<div id="portal-content">
    <div id="detailByModel">
        <portal:box title="Detail By Model" style="width: 800px">
            <portal:subSection title="General Specifications">

                <p>Manufacturer: <c:out value="${equipmentItemViewHelper.itemModelManufacturerName}"/></p>

                <p>Model: <c:out value="${equipmentItemViewHelper.itemModelName}" /></p>

                <p>Processor Speed: <c:out value="${equipmentItemViewHelper.itemModelProcessorSpeed}"/></p>
            </portal:subSection>

            <portal:subSection title="Item List">
                <display:table name="equipmentItemViewHelper.allByModel"
                               excludedParams="method"
                               style="width: 100%"
                               id="equipmentItem">
                    <display:column title="Serial Number"
                            style="text-align:center">
                        <html:link href="equipmentItemAction.do?method=viewItemPage&itemId=${equipmentItem.id}"><c:out value="${equipmentItem.serial}" /></html:link>

                    </display:column>
                    <display:column title="User">
                        <c:out value="${equipmentItem.assignedUser.displayName}" />
                    </display:column>
                    <display:column title="Purchase Cost">
                        <fmt:formatNumber value="${equipmentItem.originalCost}" type="currency" />
                    </display:column>
                    <display:column title="Actions">
                        <html:link href="equipmentItemAction.do?method=viewAssignEquipmentToUser&itemId=${equipmentItem.id}">Assign</html:link>
                        <html:link href="equipmentItemAction.do?method=unassignItem&itemId=${equipmentItem.id}&inputPage=viewByModel">Unassign</html:link>
                    </display:column>
                </display:table>

            </portal:subSection>
        </portal:box>
    </div>
</div>
</body>
</html>